<?php

/**
 * TipoComprobante form base class.
 *
 * @method TipoComprobante getObject() Returns the current form's model object
 *
 * @package    sf_sandbox
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseTipoComprobanteForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'nombre'      => new sfWidgetFormInputText(),
      'abreviatura' => new sfWidgetFormChoice(array('choices' => array('FC' => 'FC', 'FO' => 'FO', 'RD' => 'RD', 'FCPF' => 'FCPF', 'CD' => 'CD', 'NDC' => 'NDC', 'NDO' => 'NDO'))),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'nombre'      => new sfValidatorString(array('max_length' => 60)),
      'abreviatura' => new sfValidatorChoice(array('choices' => array(0 => 'FC', 1 => 'FO', 2 => 'RD', 3 => 'FCPF', 4 => 'CD', 5 => 'NDC', 6 => 'NDO'))),
    ));

    $this->widgetSchema->setNameFormat('tipo_comprobante[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'TipoComprobante';
  }

}
